package com.example.es.rest;

import com.example.es.business.user.dto.SysUserDTO;
import com.example.es.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Pageable;
import org.springframework.data.web.PageableDefault;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author WangKun
 * @create 2019-01-11
 * @desc
 **/
@RestController
public class UserRest {

    @Autowired
    UserService userService;

    @RequestMapping("/user/list")
    public List<SysUserDTO> list(@PageableDefault Pageable pageable) {
        List<SysUserDTO> list = userService.list(pageable);
        return list;
    }
}
